#!/bin/sh

# Run Maven Checkstyle before committing code changes
mvn checkstyle:check

# Check if the Maven Checkstyle build failed and stop the commit if so
if [ "$?" -ne 0 ]
then
    echo "Maven Checkstyle build failed. Commit aborted."
    exit 1
fi

# If everything is OK, continue with the commit
exit 0